package cn.stylefeng.guns.modular.gridsystem.enums;

import cn.stylefeng.guns.core.annotion.ExpEnumType;
import cn.stylefeng.guns.core.exception.enums.abs.AbstractBaseExceptionEnum;
import cn.stylefeng.guns.core.factory.ExpEnumCodeFactory;
import cn.stylefeng.guns.modular.gridsystem.constants.BizExpEnumConstant;

@ExpEnumType(module = BizExpEnumConstant.GUNS_MAIN_MODULE_EXP_CODE, kind = BizExpEnumConstant.MATERIAL_EXCEPTION_ENUM)
public enum  BizStationsExceptionEnum implements AbstractBaseExceptionEnum {

    /**
     * 站点不存在
     */
    NOT_EXIST(1, "站点不存在!"),

    /**
     * 站点下面存在网关，不允许删除
     */
    HAVE_GATEWAY_NOT_ALLOWED_DELETE(2, "站点下面存在网关，不允许删除!"),

    /**
     * 站点下面存在设备，不允许删除
     */
    HAVE_DEVICE_NOT_ALLOWED_DELETE(3, "站点下面存在设备，不允许删除!");

    private final Integer code;

    private final String message;

    BizStationsExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
    }

    @Override
    public String getMessage() {
        return message;
    }
}
